﻿using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using FazaDemo.BL.InterfaceDomain;
using FazaDemo.Data;

namespace FazaDemo.BL.Services_
{
    public class MenuSetter : IMenuSetter
    {

        public IEnumerable<Menu_Item> SetMenu(IList<TS_SYS_EC_MENU> loadingItems)
        {
            var converter = new MenuConverter(loadingItems);
            IList<Menu_Item> resultItems = converter.BuildMenuItems();
            var optimiser = new MenuItemsOptimizer(resultItems);
            return optimiser.RestoreItems();
        }

    }
}
